<?php
/**
 * Group Model
 *
 * PHP versions 4 and 5
 *
 * Infectamic: Free online role playing game, easily playable by browser. (http://infectamic.goldzoneweb.info)
 * Copyright 2011, Loic Chardonnet
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2011, Loic Chardonnet
 * @link          http://infectamic.goldzoneweb.info Infectamic
 * @package       cake
 * @subpackage    cake.cake.libs.controller
 * @since         CakePHP(tm) v 0.2.9
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
class Group extends AppModel {
    var $name = 'Group';
    var $displayField = 'name';
    var $validate = array(
        'name' => array(
            'notempty' => array(
                'rule' => array('notempty'),
                'message' => 'You must give a name!',
                'allowEmpty' => false,
                'required' => true,
                'last' => false, // Stop validation after this rule
                'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
            'alphanumeric' => array(
                'rule' => array('alphanumeric'),
                'message' => 'You must give an alpha numerical value!',
                'allowEmpty' => false,
                'required' => true,
                'last' => false, // Stop validation after this rule
                'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
            'maxlength' => array(
                'rule' => array('maxlength', 255),
                'message' => 'You must give a name shorter than 255 characters!',
                'allowEmpty' => false,
                'required' => true,
                'last' => false, // Stop validation after this rule
                'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
            'minlength' => array(
                'rule' => array('minlength', 2),
                'message' => 'You must give a name longer than 2 characters!',
                'allowEmpty' => false,
                'required' => true,
                'last' => false, // Stop validation after this rule
                'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
    );
    //The Associations below have been created with all possible keys, those that are not needed can be removed

    var $hasMany = array(
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'group_id',
            'dependent' => false,
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'limit' => '',
            'offset' => '',
            'exclusive' => '',
            'finderQuery' => '',
            'counterQuery' => ''
        )
    );
}
?>